package com.bosssoft.trainee.common.exception;


import com.bosssoft.trainee.mbg.result.IErrorCode;

/**
 * 自定义API异常
 */
public class ApiException extends RuntimeException {
    private final IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message, IErrorCode errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }
}
